require 'spec/rake/spectask'
require 'rake/gempackagetask'

desc "Run all specs"
Spec::Rake::SpecTask.new(:spec) do |t|
  t.spec_files = FileList[
    'spec/spec_helper.rb',
    'spec/**/*_spec.rb',
  ]
  t.rcov = false
end

desc "Run all specs w/ coverage"
Spec::Rake::SpecTask.new(:spec_cov) do |t|
  t.spec_files = FileList[
    'spec/spec_helper.rb',
    'spec/**/*_spec.rb',
  ]
  t.rcov = true
  t.rcov_dir = 'doc/output/coverage'
  t.rcov_opts = ['--exclude', 'spec\/spec,examples']
end

gem_spec = Gem::Specification.new do | s |
    s.name = "rcomp"
    s.version = "0.1.2"
    s.author = "Ray Vernagus"
    s.summary = "Use Rake to compile your projects."

    s.autorequire = 'rcomp'
    s.platform = Gem::Platform::RUBY
    s.files = Dir.glob("{spec,lib}/**/*.rb")
end

desc "Build gem"
Rake::GemPackageTask.new(gem_spec) do | pkg |
    pkg.need_tar = false
    pkg.need_zip = true
end
